from building import *

CWD = GetCurrentDir()
objs = Glob('*.c')
objscpp = Glob('cpp/src/*.cpp')


@register_library
class LibrarySomeIp(Library):
    def config(self):
        self.CPPDEFINES = []
        self.CPPPATH = ['$INFRAS', CWD]
        self.LIBS = ['SoAd', 'MemPool', 'OSAL']
        self.source = objs
        if IsBuildForHost():
            USE_PCAP = os.getenv('USE_PCAP')
            if USE_PCAP == 'YES':
                self.LIBS += ['PCap']
                self.CPPDEFINES += ['USE_PCAP']
            self.include += ['%s/cpp/include'%(CWD)]
            self.LIBS += ['Utils', 'Plugin']
            self.source += objscpp
            if not IsBuildForWindows():
                self.CPPFLAGS = ['--std=c++17']

